package com.raos.example.thread.controller;

import com.raos.example.thread.entity.UserEntity;
import com.raos.example.thread.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * UserController
 *
 * @author raos
 * @email 991207823@qq.com
 * @date 2022/6/16 0016 11:43
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/register")
    public UserEntity register() {
        return userService.register();
    }

    @GetMapping("/getAll")
    public String getAllNum() {
        return "注册用户数" + userService.getAll().size();
    }

}
